import * as type from "./mutation-types";

const mutations = {
    [type.SET_SINGER](state,singer){
        state.singer = singer
    },
    [type.SET_PLAYING_STATE](state,flag){
        state.playing = flag
    },
    [type.SET_FULL_SCREEN](state,flag){
        state.fullScreen = flag;
    },
    [type.SET_PLAYLIST](state,list){
        state.playList = list;
    },
    [type.SET_SEQUENCE_LIST](state,list){
        state.sequenceList = list;
    },
    [type.SET_CURRENT_INDEX](state,index){
        state.currentIndex = index
    },
    [type.SET_PLAYLIST_URL](state,keyUrl){
        let index = keyUrl.index
        let url = keyUrl.url
        state.playList[index].url = url
    },
    [type.SET_PLAY_MODE](state,mode){
        state.playMode = mode
    },
    [type.SET_DISC](state,disc){
        state.disc = disc
    },
    [type.SET_TOPLIST](state,list){
        state.topList = list
    },
    [type.SET_SEARCH_HISTORY](state,history){
        state.searchHistory = history
    },
    [type.SET_PLAY_HISTORY](state,history){
        state.playHistory = history
    }
}
export default mutations